import request from '@/utils/request'

// 查询栏目-总
export function homeCategory() {
    return request({
      url: 'system/category/findbyparentcategoryid?categoryid='+ '0',
      method: 'post'
    })
}

// 查询栏目-下级
export function homeCategorylist(id) {
    return request({
      url: 'system/category/findbyparentcategoryid?categoryid='+ id,
      method: 'post'
    })
}

// 查询新闻列表
export function getNewslisthome(id,pn,ps) {
  return request({
    url: 'system/info/find_sy_passed_by_categoryid_paging?categoryid='+ id + '&pageindex=' + pn + '&pagesize=' + ps,
    method: 'post'
  })
}



export function getNewslist(id,tit,pn,ps) {
    return request({
      url: 'system/info/find_passed_by_categoryid_paging?categoryid='+ id + '&infotitle=' + tit + '&pageindex=' + pn + '&pagesize=' + ps,
      method: 'post'
    })
}

// 指定单位查询新闻列表
export function getNewslistdept(id,tit,pn,ps) {
  return request({
    url: 'system/info/find_passed_by_categoryid_and_deptids_paging?categoryid='+ id + '&deptids=' + tit + '&pageindex=' + pn + '&pagesize=' + ps,
    method: 'post'
  })
}


// 查询单条新闻详情
export function infoDetail(id) {
    return request({
      url: 'system/info/findone?infoid='+ id,
      method: 'post'
    })
}

// 查询栏目-下级-左侧
export function leftCategorylist(id) {
  return request({
    url: 'system/category/findallxiajibyparentcategoryid?categoryid='+ id,
    method: 'post'
  })
}

// 博士后科研流动站设站单位
export function getLdzdept(data) {
  return request({
    url: 'https://www.chinapostdoctor.org.cn/website/api/info/chaxun_bshshezhandanwei',
    data: data,
    method: 'post'
  })
}

// 所属部门
export function getBumen() {
  return request({
    url: 'https://www.chinapostdoctor.org.cn/ssdict/api/ds/danweisuoshuxiangxibumen/find_valid ',
    method: 'get'
  })
}

// 查询新闻列表
// url: 'system/info/findxiajiallinfobycategoryid?categoryid='+ id,
export function getNewsSan(id) {
  return request({
    url: 'system/info/find_passed_by_sjcategoryid?categoryid='+ id,
    method: 'post'
  })
}

// 搜索列表
export function searchList(tit,pn,ps) {
  return request({
    url: 'system/info/find_by_infotitle_paging?infotitle='+ tit + '&pageindex=' + pn + '&pagesize=' + ps,
    method: 'post'
  })
}

// 搜索列表2
export function searchListtwo(tit,pn,ps,sj,q,z,fw,lm,cid,px) {
  return request({
    url: 'system/info/find_jiansuoinfo_by_categoryid_paging?neirong='+ tit + '&pageindex=' + pn + '&pagesize=' + ps +'&shijian=' + sj + '&qi=' + q + '&zhi=' + z + '&fanwei=' + fw + '&shifouxuanzelanmu=' + lm + '&categoryid=' + cid + '&paixu=' + px,
    method: 'post'
  })
}

// export function searchListtwo(data) {
//   return request({
//     url: 'system/info/find_jiansuoinfo_by_categoryid_paging',
//     method: 'post',
//     data
//   })
// }


